package junit;

import dao.UserDao;
import dao.impl.UserDaoImpl;
import org.junit.Test;
import pojo.User;

import static org.junit.Assert.*;

/**
 * @author Wxt
 * @create 2022-02-08 11:01
 */
public class UserDaoTest {
    private UserDao userDao = new UserDaoImpl();

    @Test
    public void queryUserByUsername() {
        User user = userDao.queryUserByUsername("admin");
        System.out.println(user);
    }

    @Test
    public void queryUserByUsernameAndPassword() {
        User user = userDao.queryUserByUsernameAndPassword("admin", "admin");
        System.out.println(user);
    }

    @Test
    public void saveUser() {
        int i = userDao.saveUser(new User(null, "wxt168", "666666", "wxt@168.com"));
        System.out.println(i);

    }
}